package dao;

import java.sql.SQLException;
import java.util.List;

import model.Announces;
import model.User;

public interface UserDao {
	//得到所有用户对象
	List<User> getAllUser() throws SQLException;
	//根据用户名和密码得到用户
	User getUserByIdAndPwd(String id , String password) throws SQLException;
	//根据用户ID得到用户对象
	User getUserById(String id) throws SQLException;
	//注册
	boolean register(User user) throws SQLException;
	boolean register(String id, String name, String sex, String pwd1,String phone) throws SQLException;
	//根据主体列表得到当前主体下的用户信息
	List<User> getUserListByAnn(List<Announces> annList) throws SQLException;
	//根据用户ID和手机号得到用户
	User getUserByIdAndPhone(String id , int phone) throws SQLException;
	//修改密码的方法
	boolean resetPwd(String password , String userid) throws SQLException;
	//注销账户的方法
	boolean rmByIdAndPwd(String userid, String password) throws SQLException;
	
}
